<div class="categories">
    <ul>
        <?php 
            foreach($categories as $category):
                $uri    = get_base_url() . url_title($category->category, 'dash', TRUE) . '-c' . $category->id;
                $image  = ($category->url_images != '' && $category->url_images != NULL) ? $category->url_images : 'default.jpg';
        ?>
        <li>
            <a href="<?php echo $uri;?>">
                <img class="img" src="/images/categories/<?php echo $image;?>"/>
            </a>
            <table style="width: 100%;">
                <tr>
                    <td class="link"><a href="<?php echo $uri;?>"><?php echo $category->category;?></a></td>
                </tr>
                <tr>
                    <td class="description"><?php echo shorten_str($category->description, 90);?> </td>
                </tr>
            </table>
        </li>
        <?php endforeach;?>
    </ul>
</div> 